{%extends "base_template.html"%}
{%block HEAD%}
<script type="text/javascript">
function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}
function check_submit()
{
	twuser = document.getElementById('twitter_username')
	twpass = document.getElementById('twitter_password')
	ret = true
	twuser.value = trim(twuser.value)
	if (twuser.value == '')
	{
		ret = false;
		document.getElementById('n1').style.display = '';
	}
	else
	{
		document.getElementById('n1').style.display = 'none';
	}
	if (twpass.value == '')
	{
		ret = false;
		document.getElementById('n2').style.display = ''
	}
	else
	{
		document.getElementById('n2').style.display = 'none'
	}
	return ret;
}
</script>
{%endblock%}
{%block BODY%}
<h1>绑定Twitter账号</h1>
{%if isbinding%}
当前绑定的Twitter账户为：{{twitter_username}}，请修改绑定。<br />
{%else%}
请输入Twitter账号，进行绑定。<br />
{%endif%}
<div style="color:red">{{msg}}</div>
<form method="post" onsubmit="return check_submit()">
Twitter账号：<input type="text" name="twitter_username" id="twitter_username"/><span id="n1" style="color:red;display:none">请输入账号</span><br />
Twitter密码：<input type="password" name="twitter_password" id="twitter_password"/><span id="n2" style="color:red;display:none">请输入密码</span><br />
<input type="submit" value="绑定"/>
</form>
{%endblock%}
